<clr-modal [(clrModalOpen)]="modalOpened" [clrModalSize]="'lg'">
  <h3 class="modal-title">{{title}}</h3>
  <div class="modal-body">
    <form #cronjobForm="ngForm" style="padding-right: 30px;width: 100%">
      <section class="form-block">
        <div class="form-group" style="padding-left: 135px;">
          <label for="cronjob_name" class="col-md-3 form-group-label-override required">名称</label>
          <label for="cronjob_name" aria-haspopup="true" role="tooltip" [class.invalid]="!isNameValid"
                 class="tooltip tooltip-validation tooltip-md tooltip-bottom-left">
            <label *ngIf="app && actionType==0 && nameGenerateRuleConfig=='join'">{{app.name}}-</label>
            <input type="text" id="cronjob_name" [(ngModel)]="cronjob.name"
                   name="cronjob_name" size="40"
                   required
                   [readonly]="actionType==1"
                   placeholder="英文小写，中划线分隔"
                   pattern="[a-z]([-a-z0-9]*[a-z0-9])?"
                   maxlength="64"
                   (keyup)='handleValidation()'>
            <span class="tooltip-content">
              名称不符合规范，验证规则[a-z]([-a-z0-9]*[a-z0-9])?
        </span>
          </label>
          <span class="spinner spinner-inline" [hidden]="!checkOnGoing"></span>
        </div>
        <div class="form-group" style="padding-left: 135px;">
          <label class="col-md-3 form-group-label-override required">机房</label>
          <div *ngFor="let cluster of clusters" class="checkbox-inline">
            <div class="checkbox">
              <input [(ngModel)]="clusterMetas[cluster.name].checked"
                     type="checkbox"
                     id="{{cluster.name}}-check"
                     name="{{cluster.name}}-check">
              <label for="{{cluster.name}}-check">{{cluster.name}}</label>
            </div>
          </div>
        </div>
        <div class="form-group" style="padding-left: 135px;">
          <label for="cronjob_description" class="col-md-3 form-group-label-override">描述</label>
          <textarea id="cronjob_description" [(ngModel)]="cronjob.description"
                    name="cronjob_description"
                    rows="3">
          </textarea>

        </div>
      </section>
    </form>
  </div>
  <div class="modal-footer" style="padding-right: 5%">
    <button type="button" class="btn btn-outline" (click)="onCancel()">取消</button>
    <button type="button" class="btn btn-primary" [disabled]="!isValid" (click)="onSubmit()">提交</button>
  </div>
</clr-modal>

